<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2019/11/1
  Time: 11:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link href="https://cdn.bootcss.com/twitter-bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        function x() {
            location.href = "add.jsp";
        }
    </script>
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="row clearfix">
                <div class="col-md-12 column" align="conter">
                    <h3 class="text-success" style="text-align:center">
                        房产信息查询
                    </h3>
                </div>
            </div>
            <div class="row clearfix">

                <div class="col-md-6 column">
                    <form class="form-horizontal" role="form" action="Servlet?method=findall" method="get">
                        <input value="findall" name="method" type="hidden">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">查询类型：</label>
                            <select name="Dt">
                                <option value="0" ${dtid==0? "selected":""}>全部</option>
                                <option value="1" ${dtid==1? "selected":""}>用户名</option>
                                <option value="2" ${dtid==2? "selected":""}>身份证</option>
                            </select>
<%--                            这里写什么，value就为什么，value为输入框的数据--%>
                            <input name="note" type="text" value="${note}">
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-default">查找</button>
                            </div>
                        </div>

                    </form>
                </div>


                <div class="col-md-6 column">
                    <button type="button" class="btn btn-default btn-danger" onclick="x()">添加房产信息</button>
                </div>

            </div>

        </div>
        <table class="table">
            <thead>
            <tr>
                <th>序号</th>
                <th>项目名称</th>
                <th>产权人</th>
                <th>身份证号</th>
                <th>房屋类型</th>
                <th>使用面积</th>
                <th>建造时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${pageUtils.dataList}" var="a">
                <tr>
                    <td>${a.id}</td>
                    <td>${a.projectName}</td>
                    <td>${a.name}</td>
                    <td>${a.cardId}</td>
                    <td>${a.houseType}</td>
                    <td>${a.area}</td>
                    <td>${a.buildTime}</td>
                    <td>
                        <a href="Servlet?method=delectServlet&id=${a.id}">删除</a>
                        &nbsp;&nbsp;
                        <a href="Servlet?method=findById&id=${a.id}">修改</a>
                        &nbsp;&nbsp;
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <ul class="pagination">
            <li>
                <a href="Servlet?method=findall&index=1&Dt=${dtid}&note=${note}">首页</a>
            </li>

            <li>
                <a href="Servlet?method=findall&index=${pageUtils.pageIndex-1>0?pageUtils.pageIndex-1:1}&Dt=${dtid}&note=${note}">上一页</a>
            </li>

            <li>
                <a href="Servlet?method=findall&index=${pageUtils.pageIndex+1>pageUtils.totalPages?pageUtils.totalPages:pageUtils.pageIndex+1}&note=${note}&Dt=${dtid}">下一页</a>
            </li>

            <li>
                <a href="Servlet?method=findall&index=${pageUtils.totalPages}&Dt=${dtid}&note=${note}">尾页</a>
            </li>
            第${pageUtils.pageIndex}页
            共${pageUtils.totalPages}页
            总计${totalCount}条
        </ul>
    </div>
</div>
</div>

</body>
</html>
